#{extends 'main.html'/}
  <div class="row wrapper white-bg page-heading">
        <!-- <div class="wrapper wrapper-content animated fadeInRight"> -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>用户编辑</h5>
                        </div>
                        <div class="ibox-content">
                        #{form @security.Users.update(user?.id),method:'PUT',id:'editForm',class:'form-horizontal'}
                              <div class="form-group form-inline">
                                #{f.text_field 'user.name',label:'姓名',required:'true',value:user?.name,maxlength:16 /}
                            </div>
                            <div class="form-group form-inline">
                                #{f.text_field 'user.userName',label:'用户名',required:'true',value:user?.userName,maxlength:32 /}
                            </div>
                            <div class="form-group form-inline">
                                #{f.password 'user.password',label:'密码',required:'true',value:user?.password,maxlength:64/}
                            </div>
                            <div class="form-group form-inline">
                                #{f.password 'user.confirmPassword',label:'密码确认',required:'true',value:user?.password,maxlength:64 /}
                            </div>
                           <div class="form-group form-inline">
                                 #{f.assign 'rids',id:'role',label:'分配角色',size:'7',unassign:editData.roles,assigned:editData.rids,labelProperty:'value',valueProperty:'key'/}
                           </div>
                   
                                <div class="form-group">
                                    <div class="col-sm-4">
                                       #{f.button '保存',href:'javascript:submitForm();',class:"btn btn-primary" /}
                                       #{f.button '取消',href:@security.Users.index(),class:"btn btn-white"/}
                                      
                                    </div>
                                </div>
                           #{/form}
                        </div>
                    </div>
                </div>
            </div>
        </div>
         <script type="text/javascript">
       function submitForm(){
          $("select[name=rids]").find('option').attr('selected',true);
          $('#editForm').submit();    
       }
       </script>      
        